import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path:'/demo2',
    name:"axios请求方法",
    component:()=>import('../views/demo2.vue')
  },
  {
    path:'/demo3',
    name:"axios并发请求",
    component:()=>import('../views/demo3.vue')
  },
  {
    path:'/demo4',
    name:"axios实例",
    component:()=>import('../views/demo4.vue')
  },
  {
    path:'/demo5',
    name:"axios配置参数",
    component:()=>import('../views/demo5.vue')
  },
  {
    path:'/demo6',
    name:"axios拦截器",
    component:()=>import('../views/demo6.vue')
  },
  {
    path:'/demo7',
    name:"axios错误拦截",
    component:()=>import('../views/demo7.vue')
  },
  {
    path:'/ContactList',
    name:"联系人综合实例",
    component:()=>import('../views/ContactList.vue')
  },
  {
    path:'/ContactList_http',
    name:"联系人综合实例2",
    component:()=>import('../views/ContactList_http.vue')
  }                    
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
